package com.itheima.controller;

import com.itheima.constant.MessageConstant;
import com.itheima.entity.Result;
import com.itheima.service.AddressService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/address")
public class AddressController {
    @Reference
    private AddressService addressService;
    @RequestMapping("/findAdd")
    public Result findAdd() {
        try {
            List<Map> list= addressService.findAdd();
            return new Result(true, MessageConstant.QUERY_ADDRESS_SUCCESS,list);
        } catch (Exception e) {
            return new Result(false,MessageConstant.QUERY_ADDRESS_FAIL);
        }

    }
}
